package org.wattdepot.cli.command;

import java.util.List;
import org.wattdepot.cli.CommandLineInterface;

/**
 * Prints the commands and their purpose.
 * 
 * @author Anthony Xu & John Mack
 * 
 */
public class Help implements WattDepotCliCommand {

  /**
   * Prints the commands and their purpose.
   * 
   * @param cli WattDepotClient with hostUri = http://server.wattdepot.org:8182/wattdepot/
   * @param commands user's command line input
   * @return string to output
   */
  public String doCommand(CommandLineInterface cli, List<String> commands) {
    String str = "";
    str = str + "help\n";
    str = str + "This message\n";
    str = str + "quit\n";
    str = str + "Exits the system\n";
    str = str + "sources\n";
    str = str + "Prints a table summarizing the public sources in the system, one per " + "line.\n";
    str = str + "source {source} summary\n";
    str = str + "Prints information about a single source.\n";
    str = str + "sensordata {source} timestamp {timestamp}\n";
    str = str + "Prints information about a single sensor data instance.\n";
    str = str + "dailysensordata {source} day {day}\n";
    str =
        str + "Prints a table listing all of the sensor data instances for the "
            + "specified day.\n";
    str = str + "power {source} timestamp {timestamp}\n";
    str = str + "Prints the power generated by the source at the given timestamp.\n";
    str =
        str + "powerstats [generated|consumed] {source} day {day} sampling-interval {minutes} "
            + "statistic {max|min|average}\n";
    str =
        str + "Returns the maximum, minimum, or average power generated by the source "
            + "for the day.\n";
    str = str + "total [carbon|energy] {source} day {day} sampling-interval " + "{minutes}\n";
    str =
        str + "Returns the total amount of carbon (or energy) emitted by this source "
            + "for the given day.\n";
    str =
        str + "chart power [generated|consumed] {source} {startday} {endday} "
            + "sampling-interval {minutes} file {file}\n";
    str =
        str + "Writes out an html file that will display a chart illustrating the "
            + "power for the source over the interval.\n";
    str = str + "fueltypes {source}\n";
    str = str + "Returns a table of fuels associated with this source.\n";
    str = str + "totalpower {source} {timestamp} fuelType {fuelType}\n";
    str = str + "Returns the total power generated by the given fuel type.\n";
    str = str + "carboncontent {source} {timestamp} sampling-interval {interval}.\n";
    str =
        str + "Returns the total carbon that would be emitted by that source over an hour "
            + "at the rate occurring as of the timestamp. ";
    return str;
  }

}
